import {defineStore} from 'pinia'

interface StateType {
	theme: string
}

export const useStoreTheme = defineStore('theme', {
	state: (): StateType => ({
		theme: localStorage.getItem('_LOCAL_THEME_') || 'default'
	}),
	getters: {
		getTheme: (state): string => state.theme,
		getThemeTest(): string {
			return this.theme
		}
	},
	actions: {
		Set(data: string) {
			this.theme = data
			localStorage.setItem('theme', data)
		}
	}
})

export default useStoreTheme;
